﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Database.DataAccess
{
    public interface IDataInstrumentationProvider
    {
        /// <summary>
        /// Fires the CommandExecuted event.
        /// </summary>
        /// <param name="startTime">The time the command started its execution.</param>
        void FireCommandExecutedEvent(DateTime startTime);

        /// <summary>
        /// Fires the CommandFailed event.
        /// </summary>
        /// <param name="commandText">The text of the command that failed its execution.</param>
        /// <param name="connectionString">The connection string of the <see cref="DatabaseBase"/> that executed the failed command, with credentials removed.</param>
        /// <param name="exception">The exception thrown when the command failed.</param>
        void FireCommandFailedEvent(string commandText, string connectionString, Exception exception);

        /// <summary>
        /// Fires the ConnectionOpened event.
        /// </summary>
        void FireConnectionOpenedEvent();

        /// <summary>
        /// Fires the ConnectionFailed event.
        /// </summary>
        /// <param name="connectionString">The connection string that caused the failed connection, with credentials removed.</param>
        /// <param name="exception">The exception thrown when the connection failed.</param>
        void FireConnectionFailedEvent(string connectionString, Exception exception);
    }
}
